import 'dart:convert';

class GameInfo {
  GameInfo({
    String? id,
    String? name,
    String? gameId,
  }) {
    _id = id;
    _name = name;
    _gameId = gameId;
  }

  GameInfo.fromJson(dynamic json) {
    _id = json['_id'];
    _name = json['name'];
    _gameId = json['game_id'];
  }

  String? _id;
  String? _name;
  String? _gameId;

  GameInfo copyWith({
    String? id,
    String? name,
    String? gameId,
  }) =>
      GameInfo(
        id: id ?? _id,
        name: name ?? _name,
        gameId: gameId ?? _gameId,
      );

  String? get id => _id;

  String? get name => _name;

  String? get gameId => _gameId;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['_id'] = _id;
    map['name'] = _name;
    map['game_id'] = _gameId;
    return map;
  }

  @override
  String toString() {
    return jsonEncode(this).toString();
  }
}
